/**
 * @description 问卷标题组件
 * @author 大肘子
 */

import React, { FC } from 'react'
import style from './index.module.scss'

type QuestionTitleType = {
  fe_id: string
  props: {
    title: string
    level: number
    iscenter: boolean
  }
}

const QuestionTitle: FC<QuestionTitleType> = ({ fe_id, props }) => {
  const { title, level = 1, iscenter } = props
  let fontsize = '32px'
  switch(level){
    case 1:
        fontsize = '32px'
        break
    case 2:
        fontsize = '24px'
        break  
    case 3:
        fontsize = '18.72px'
        break 
    case 4:
        fontsize = '16px'
        break
    case 5:
        fontsize = '13.28px'
        break                
  }
    
  return (
    <>
      <p className={style.title} style={{ textAlign: iscenter ? 'center' : 'start',fontSize: fontsize}}>
        {title}
      </p>
    </>
  )
}

export default QuestionTitle
